// ********* Timer.h***********
#ifndef TIMER_H
#define TIMER_H
#include <time.h>
#include <iostream>
using namespace std;

class Timer
{
    public:
        Timer::Timer(){
        }
        Timer::~Timer(){
        }
        void Timer::start(){
            _start = clock();
        }
        void Timer::stop(){
            _finish = clock();
        }
        long long int Timer::getTicks() const{
            return (_finish-_start);
        }
        double Timer::getSeconds() const{
            double aux = (_finish-_start);
            aux = aux/(double)CLOCKS_PER_SEC;
        return aux;
        }
       
    private:
        clock_t _start;
        clock_t _finish;

};

ostream& operator<<(ostream& out, const Timer& t){
            double aux = t.getSeconds();
            int min = aux/60;
            double seg = aux-(min*60);
            
            out << "Tiempo: " << min << "m " << seg << "s"<< endl;
            return out;
        }
#endif /* TIMER_H */
